<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    function foo(){
        this.name = 'foo';
    }
    function bar(){

    }
    bar.prototype = new foo();
    var goo = new bar();
    alert(goo.name); //foo
    alert(bar.prototype.isPrototypeOf(goo));//true，在bar的原型链中有当前对象goo，则isPrototypeOf方法返回true
</script>
</body>
</html>